#include <iostream>
using namespace std;

int kvadr_znach (int a);
void kvadr_ukaz(int *b);
void kvadr_ss(int &c);
int* f_arr(const int *arr, const int n);

char *f_str(char *str1, int len);


int main()
{


    int x1,y1;
    cout<<"x1=";
    cin>>x1;
    y1=kvadr_znach(x1);
    cout<<"y1="<<y1<<endl;

    cout<<endl;


    int *x2;
    x2=new int;
    cout<<"x2=";
    cin>>*x2;
    kvadr_znach(*x2);
    cout<<"x2="<<*x2<<endl;
    delete x2;

    cout<<endl;


    int x3;
    int &rx3=x3;
    cout<<"x3=";
    cin>>rx3;
    kvadr_ss(rx3);
    cout<<"rx3="<<rx3<<endl;
    cout<<"x3="<<x3<<endl;

    cout<<endl;


    int n1=5;
    int mass1[n1];
    for (int i=0; i<n1; i++)
    {
        mass1[i]=i*i;
        cout<<"mass1["<<i+1<<"]="<<mass1[i]<<endl;
    }
        cout<<endl;
    f_arr(mass1, n1);

    cout<<endl;


    int l;
    cout<<"length=";
    cin>>l;
    char *s1=new char [l];
    f_str(s1, l);
    delete [] s1;

    return 0;
}


int kvadr_znach (int a)
{
    return a*a;
}


void kvadr_ukaz (int *b)
{
    *b=(*b)*(*b);
}


void kvadr_ss (int &c)
{
    c=c*c;
}


int* f_arr(const int *arr, const int n)
{
    int *res=new int[n];
    for (int i=0; i<n; i++)
    {
        res[i] = arr[i]+1;
        cout<<"mass2["<<i+1<<"]="<<res[i]<<endl;
    }

    return res;
}


char* f_str(char *str1, int len)
{
    char *str2=new char[len];
    for (int i=0; i<len; i++)
    {
        cin>>str1[i];
        str2[i]=str1[i];
    }
    str1[len]='\0';
    str2[len]='\0';
    cout<<str2;
    return str2;
}
